import requests


class RegisterApi:

    def register(self, session, test_body):
        session.get(url="http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=verify&type=user_reg")

        return session.post(url="http://hmshop-test.itheima.net/Home/User/reg.html",
                            data=test_body)


# if __name__ == '__main__':
    #     register_01 = RegisterApi()
    # test_body = {"auth_code": "TPSHOP",
    #              "scene": 1,
    #              "username": "17671791746",
    #              "verify_code": "8888",
    #              "password": "123456",
    #              "password2": "123456",
    #              "invite": ""}
    # ret = register_01.register(test_body)
    # print("手机号重复", ret.json())

    #     register_01 = RegisterApi()
    #     test_body = {"auth_code": "TPSHOP",
    #                  "scene": 1,
    #                  "username": "17679783746",
    #                  "verify_code": "8888",
    #                  "password": "123456",
    #                  "password2": "123456",
    #                  "invite": ""}
    #     ret = register_01.register(test_body)
    # print("注册成功",ret.json())

    # register_01 = RegisterApi()
    # test_body = {"auth_code": "TPSHOP",
    #              "scene": 1,
    #              "username": "17671700746",
    #              "verify_code": "8888",
    #              "password": "123456",
    #              "password2": "123456",
    #              "invite": ""}
    # ret = register_01.register(requests.session(), test_body)
    # print("两次密码不一致", ret.json())
